//
// Created by 25238 on 2024-01-13.
//

#ifndef SELECTION_SORT_INSERTSORT_H
#define SELECTION_SORT_INSERTSORT_H

#include <iostream>
#include <algorithm>

template<typename T>
void insertSort(T arr[], int n){
    for(int i = 1; i < n; i++){
        T e = arr[i];
        int j;
        for(j = i; j > 0 && arr[j-1] > e; j--)
            arr[j] = arr[j-1];
        arr[j] = e;
    }
}
#endif //SELECTION_SORT_INSERTSORT_H
